@extends('layout.home')
@section('title', '远程运维平台数据监测(试行)')
@section('content')
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html, body {
            width: 100%;
            height: 100%;
        }

        table {
            border-collapse: collapse;
            border: none;
            width: 200px;
        }

        td, tr ,th{
            border: solid #000 1px;
            text-align: center;
        }
        th{
            height: 30px;
        }
        .title{color: black;}
        .title2{font-size: 12px;}
    </style>
    @foreach($list1 as $k => $v)
        @if($v->time_rate)
    <div style="background-color: orange;text-align: center;font-weight: bold">
        <p style="line-height: 25px" class="title">{{$v->product_line_name}}</p>
        <p style="line-height: 25px" class="title title2">采集时间:{{$curtime}}</p>
    </div>
    <table style="width:100%; height:150px">
        <tr>
            <td style="font-weight: bold;width: 25%" colspan="4">OEE</td>
            <td style="font-weight: bold;width: 25%" colspan="4">性能开动率</td>
            <td style="font-weight: bold;width: 25%" colspan="4">时间开动率</td>
            <td style="font-weight: bold;width: 25%" colspan="4">合格率</td>
        </tr>

            <tr>
                @if($v->oee>0)
                <td colspan="4">{{$v->oee}}</td>
                @else
                <td colspan="4">0.00%</td>
                @endif
                <td colspan="4">{{$v->performance_rate}}</td>
                <td colspan="4">{{$v->time_rate}}</td>
                <td colspan="4">{{$v->qualified_rate}}</td>
            </tr>

        <tr>
            <td style="font-weight: bold;width: 25%" colspan="4">运行时长</td>
            <td style="font-weight: bold;width: 25%" colspan="4">待机时长</td>
            <td style="font-weight: bold;width: 25%" colspan="4">停机时长</td>
            <td style="font-weight: bold;width: 25%" colspan="4">故障时长</td>
        </tr>


                <tr>
                    <td colspan="4">{{$v->run_duration}}min</td>
                    <td colspan="4">{{$v->standby_duration}}min</td>
                    <td colspan="4">{{$v->shutdown_duration}}min</td>
                    <td colspan="4">{{$v->fault_duration}}min</td>
                </tr>


    </table>
        @else
            <div style="height: 50px;background-color: orange;text-align: center;line-height: 50px;font-weight: bold">
                <p style="line-height: 25px" class="title">{{$v->product_line_name}}</p>
                <p style="line-height: 25px" class="title title2">采集时间:{{$curtime}}</p>
            </div>
            <table style="width:100%; height:150px">
                <tr>
                    <td style="font-weight: bold;width: 25%" colspan="4">OEE</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">性能开动率</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">时间开动率</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">合格率</td>
                </tr>

                <tr>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                </tr>

                <tr>
                    <td style="font-weight: bold;width: 25%" colspan="4">运行时长</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">待机时长</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">停机时长</td>
                    <td style="font-weight: bold;width: 25%" colspan="4">故障时长</td>
                </tr>


                <tr>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                    <td colspan="4">0</td>
                </tr>


            </table>
        @endif
    @endforeach
    <div style="height: 100px;"></div>
@endsection
